import { View, Text } from '@tarojs/components'
import { useLoad } from '@tarojs/taro'
import { useRequest, useSetState } from 'ahooks'
import { HtmlView } from '@/components/taro-html-view'
import { getDeviceInfo } from '@/api';

import './index.scss'

export default function Device() {

  // const { data: { data: vip } = {} } = useRequest(getVipRule, {})

  const [vipData, setVipData] = useSetState({});

  useLoad(async (opts) => {
    // console.log('Page loaded.', opts)
    const { data } = await getDeviceInfo({ slug: 'device' });
    setVipData({...data});
  })

  return (
    <View className='viprule'>
      <HtmlView previewImage className='level-html' html={vipData?.body || ''} />
    </View>
  )
}
